import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_douban/config/app_colors.dart';
import 'package:flutter_douban/main_page/home/notes/commit_cell.dart';

class CustomShareView extends StatelessWidget {

  static showShareView(BuildContext context,List _commotList) {
    showModalBottomSheet(
        context: context,
        backgroundColor: Colors.white.withAlpha(0),
        elevation: 2,
        builder: (BuildContext context) {
          return ClipRRect(
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(10), topRight: Radius.circular(10)),
            child: Container(
              height: 1000,
              color: Color.fromRGBO(255, 255, 255, 1),
              child: Stack(
                children: [
                  Padding(
                      padding: EdgeInsets.only(top: 14, left: 15, right: 15),
                      child: Row(
                        mainAxisAlignment: MainAxisAlignment.spaceBetween,
                        children: [
                          Text(
                            "全部评论 (${_commotList.length})",
                            style: TextStyle(
                                fontSize: 14,
                                fontWeight: FontWeight.w500,
                                color: Colors.black),
                          ),
                          GestureDetector(
                            onTap: () {
                              CustomShareView()._dismiss(context);
                            },
                            child: Image.asset(
                              "assets/images/common/comment_close@2x.png",
                              width: 20,
                              height: 20,
                            ),
                          ),
                        ],
                      )),
                  Container(
                    padding: EdgeInsets.only(top: 10,left: 15,right: 15),
                    margin: EdgeInsets.only(top: 40),
                    color: Colors.white,
                    height: 400,
                    width: MediaQuery.of(context).size.width,
                    child: ListView.builder(
                        shrinkWrap: true,
                        ///禁用滑动事件
                        physics: AlwaysScrollableScrollPhysics(),
                        itemCount: _commotList.length,
                        itemBuilder: (BuildContext context, int index) {
                          return CommitCell(
                            model: _commotList[index],
                            commotList: _commotList,
                            index: index,
                          );
                        }),
                  ),
                ],
              ),
            ),
          );
        });
  }

  _dismiss(BuildContext context) {
    Navigator.pop(context);
  }

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    throw UnimplementedError();
  }
}
